﻿<window:MetroDPIWindow x:Class="CircuitDiagram.winComponentDetails"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:my="clr-namespace:CircuitDiagram"
        xmlns:window="clr-namespace:CircuitDiagram.DPIWindow;assembly=CircuitDiagram.DPIWindow"
        Title="Component Details" Height="400" Width="600" ShowInTaskbar="False" WindowStartupLocation="CenterOwner"
        TitleCaps="False" WindowTransitionsEnabled="False" EnableDWMDropShadow="True">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/VS/Colors.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/VS/Styles.xaml" />
            </ResourceDictionary.MergedDictionaries>
            <my:BinaryResourceToImageSourceConverter x:Key="BinaryResourceToImageSourceConverter" />
        </ResourceDictionary>
    </Window.Resources>
    <ListBox Name="lbxResources">
        <ListBox.ItemTemplate>
            <DataTemplate>
                <StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="ID: " />
                        <TextBlock Text="{Binding ID}" />
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="Item type: " />
                        <TextBlock Text="{Binding ItemType}" />
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="Resource type: " />
                        <TextBlock Text="{Binding ResourceType}" />
                    </StackPanel>
                    <Border Background="White" HorizontalAlignment="Left">
                        <Image Name="image" Source="{Binding Converter={StaticResource BinaryResourceToImageSourceConverter}}" />
                    </Border>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="DPI: " />
                        <TextBlock Text="{Binding Path=Source.DpiX,ElementName=image}" />
                    </StackPanel>
                </StackPanel>
            </DataTemplate>
        </ListBox.ItemTemplate>
    </ListBox>
</window:MetroDPIWindow>